package mycompiler.lexicalAnalysis;

import junit.framework.TestCase;

public class TokenProduceTest extends TestCase 
{ 
	private TokenProduce tokenproduce;
	private String s;

	protected void setUp() throws Exception
	{
		tokenproduce = new TokenProduce(s);
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testIsdigit() 
	{

		assertEquals(tokenproduce.isdigit('9'),true);
		assertEquals(tokenproduce.isdigit('a'),false);	
		assertEquals(tokenproduce.isdigit('#'),false);
		
	}

	public void testIsalpha()
	{
		assertEquals(tokenproduce.isalpha('a'),true);
		assertEquals(tokenproduce.isalpha('A'),true);
		assertEquals(tokenproduce.isalpha('4'),false);
	}

	public void testReservedLookup() 
	{
		assertEquals(tokenproduce.reservedLookup("program"),"PROGRAM");
		assertEquals(tokenproduce.reservedLookup("progr"),"ID");

	}

}
